package org.wisigoth.chat.client;

public interface UserPreferences {
	
	public static final String LOGIN_KEY = "org.wisigoth.chat.client.mockup.userlogin";
	public static final String PWD_KEY = "org.wisigoth.chat.client.mockup.userpassword";
	public static final String PRESENCE_KEY = "org.wisigoth.chat.client.mockup.presence";
	
	
	
	/**
	 * Store the login and the password in the preferences
	 * 
	 * @param login the login value to store in user preferences or null
	 * @param pwd the password value to store in user preferences or null if the previous value must be erased
	 */
	public void storeLoginParameters(String login, char[] pwd);
/**
 * Store the presence's name used when the storePresenceParameters has been called.
 * Default presence's name stored is "Available" if the presence is null.
 * @param {@link Presence}
 */
	public void storePresenceParameters(String presence);
/**
 * Add a {@link UserPreferencesListener} 	
 * @param listener
 */
	public void addUserPreferencesListener(UserPreferencesListener listener);
	/**
	 * Remove a {@link UserPreferencesListener} 	
	 * @param listener
	 */	
	public void removeUserPreferencesListener(UserPreferencesListener listener);
	/**
	 * return the username 
	 * 
	 * @return the username if the username has been stored in the preferences
	 * return null if not
	 */	
	public String getLoginPreference();
	
	/**
	 * return the password 
	 * 
	 * @return the password if the password has been stored in the preferences
	 * return null if no password has been saved
	 */
	public char[] getPasswordPreference();
/**
 * Return  the Presence state used during loggin off from the last session	
 * if no presence state has been saved in the preferences file, DefaultPresence.AVAILABLE
 * is returned
 * @return last Presence state used
 */
	public Presence getLastPresence();
	
}
